Integrand size = 21, antiderivative size = 80 \[ \int \sec ^2(c+d x) (a+b \sec (c+d x))^2 \, dx=\frac {a b \text {arctanh}(\sin (c+d x))}{d}+\frac {\left (3 a^2+2 b^2\right ) \tan (c+d x)}{3 d}+\frac {a b \sec (c+d x) \tan (c+d x)}{d}+\frac {b^2 \sec ^2(c+d x) \tan (c+d x)}{3 d} \]
[Out]
Time = 0.10 (sec) , antiderivative size = 80, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.286, Rules used = {3873, 3853, 3855, 4131, 3852, 8} \[ \int \sec ^2(c+d x) (a+b \sec (c+d x))^2 \, dx=\frac {\left (3 a^2+2 b^2\right ) \tan (c+d x)}{3 d}+\frac {a b \text {arctanh}(\sin (c+d x))}{d}+\frac {a b \tan (c+d x) \sec (c+d x)}{d}+\frac {b^2 \tan (c+d x) \sec ^2(c+d x)}{3 d} \]
[In]
[Out]
Rule 8
Rule 3852
Rule 3853
Rule 3855
Rule 3873
Rule 4131
Rubi steps \begin{align*} \text {integral}& = (2 a b) \int \sec ^3(c+d x) \, dx+\int \sec ^2(c+d x) \left (a^2+b^2 \sec ^2(c+d x)\right ) \, dx \\ & = \frac {a b \sec (c+d x) \tan (c+d x)}{d}+\frac {b^2 \sec ^2(c+d x) \tan (c+d x)}{3 d}+(a b) \int \sec (c+d x) \, dx+\frac {1}{3} \left (3 a^2+2 b^2\right ) \int \sec ^2(c+d x) \, dx \\ & = \frac {a b \text {arctanh}(\sin (c+d x))}{d}+\frac {a b \sec (c+d x) \tan (c+d x)}{d}+\frac {b^2 \sec ^2(c+d x) \tan (c+d x)}{3 d}-\frac {\left (3 a^2+2 b^2\right ) \text {Subst}(\int 1 \, dx,x,-\tan (c+d x))}{3 d} \\ & = \frac {a b \text {arctanh}(\sin (c+d x))}{d}+\frac {\left (3 a^2+2 b^2\right ) \tan (c+d x)}{3 d}+\frac {a b \sec (c+d x) \tan (c+d x)}{d}+\frac {b^2 \sec ^2(c+d x) \tan (c+d x)}{3 d} \\ \end{align*}
Time = 0.16 (sec) , antiderivative size = 71, normalized size of antiderivative = 0.89 \[ \int \sec ^2(c+d x) (a+b \sec (c+d x))^2 \, dx=\frac {a b \text {arctanh}(\sin (c+d x))}{d}+\frac {a^2 \tan (c+d x)}{d}+\frac {a b \sec (c+d x) \tan (c+d x)}{d}+\frac {b^2 \left (\tan (c+d x)+\frac {1}{3} \tan ^3(c+d x)\right )}{d} \]
[In]
[Out]
Time = 1.22 (sec) , antiderivative size = 74, normalized size of antiderivative = 0.92
method | result | size |
derivativedivides | \(\frac {\tan \left (d x +c \right ) a^{2}+2 a b \left (\frac {\sec \left (d x +c \right ) \tan \left (d x +c \right )}{2}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )-b^{2} \left (-\frac {2}{3}-\frac {\sec \left (d x +c \right )^{2}}{3}\right ) \tan \left (d x +c \right )}{d}\) | \(74\) |
default | \(\frac {\tan \left (d x +c \right ) a^{2}+2 a b \left (\frac {\sec \left (d x +c \right ) \tan \left (d x +c \right )}{2}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )-b^{2} \left (-\frac {2}{3}-\frac {\sec \left (d x +c \right )^{2}}{3}\right ) \tan \left (d x +c \right )}{d}\) | \(74\) |
parts | \(\frac {a^{2} \tan \left (d x +c \right )}{d}-\frac {b^{2} \left (-\frac {2}{3}-\frac {\sec \left (d x +c \right )^{2}}{3}\right ) \tan \left (d x +c \right )}{d}+\frac {a b \sec \left (d x +c \right ) \tan \left (d x +c \right )}{d}+\frac {a b \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{d}\) | \(79\) |
norman | \(\frac {\frac {4 \left (3 a^{2}+b^{2}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}{3 d}-\frac {2 \left (a^{2}-a b +b^{2}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5}}{d}-\frac {2 \left (a^{2}+a b +b^{2}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d}}{\left (-1+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right )^{3}}+\frac {a b \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{d}-\frac {a b \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{d}\) | \(132\) |
risch | \(-\frac {2 i \left (3 a b \,{\mathrm e}^{5 i \left (d x +c \right )}-3 a^{2} {\mathrm e}^{4 i \left (d x +c \right )}-6 a^{2} {\mathrm e}^{2 i \left (d x +c \right )}-6 b^{2} {\mathrm e}^{2 i \left (d x +c \right )}-3 a b \,{\mathrm e}^{i \left (d x +c \right )}-3 a^{2}-2 b^{2}\right )}{3 d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{3}}+\frac {a b \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{d}-\frac {a b \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{d}\) | \(139\) |
parallelrisch | \(\frac {-9 \left (\cos \left (d x +c \right )+\frac {\cos \left (3 d x +3 c \right )}{3}\right ) a b \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )+9 \left (\cos \left (d x +c \right )+\frac {\cos \left (3 d x +3 c \right )}{3}\right ) a b \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )+\left (3 a^{2}+2 b^{2}\right ) \sin \left (3 d x +3 c \right )+6 a b \sin \left (2 d x +2 c \right )+3 \sin \left (d x +c \right ) \left (a^{2}+2 b^{2}\right )}{3 d \left (\cos \left (3 d x +3 c \right )+3 \cos \left (d x +c \right )\right )}\) | \(146\) |
[In]
[Out]
none
Time = 0.28 (sec) , antiderivative size = 100, normalized size of antiderivative = 1.25 \[ \int \sec ^2(c+d x) (a+b \sec (c+d x))^2 \, dx=\frac {3 \, a b \cos \left (d x + c\right )^{3} \log \left (\sin \left (d x + c\right ) + 1\right ) - 3 \, a b \cos \left (d x + c\right )^{3} \log \left (-\sin \left (d x + c\right ) + 1\right ) + 2 \, {\left (3 \, a b \cos \left (d x + c\right ) + {\left (3 \, a^{2} + 2 \, b^{2}\right )} \cos \left (d x + c\right )^{2} + b^{2}\right )} \sin \left (d x + c\right )}{6 \, d \cos \left (d x + c\right )^{3}} \]
[In]
[Out]
\[ \int \sec ^2(c+d x) (a+b \sec (c+d x))^2 \, dx=\int \left (a + b \sec {\left (c + d x \right )}\right )^{2} \sec ^{2}{\left (c + d x \right )}\, dx \]
[In]
[Out]
none
Time = 0.20 (sec) , antiderivative size = 84, normalized size of antiderivative = 1.05 \[ \int \sec ^2(c+d x) (a+b \sec (c+d x))^2 \, dx=\frac {2 \, {\left (\tan \left (d x + c\right )^{3} + 3 \, \tan \left (d x + c\right )\right )} b^{2} - 3 \, a b {\left (\frac {2 \, \sin \left (d x + c\right )}{\sin \left (d x + c\right )^{2} - 1} - \log \left (\sin \left (d x + c\right ) + 1\right ) + \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 6 \, a^{2} \tan \left (d x + c\right )}{6 \, d} \]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 178 vs. \(2 (76) = 152\).
Time = 0.31 (sec) , antiderivative size = 178, normalized size of antiderivative = 2.22 \[ \int \sec ^2(c+d x) (a+b \sec (c+d x))^2 \, dx=\frac {3 \, a b \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - 3 \, a b \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) - \frac {2 \, {\left (3 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 3 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 3 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 6 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 2 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 3 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 3 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 3 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right )}^{3}}}{3 \, d} \]
[In]
[Out]
Time = 15.11 (sec) , antiderivative size = 141, normalized size of antiderivative = 1.76 \[ \int \sec ^2(c+d x) (a+b \sec (c+d x))^2 \, dx=\frac {2\,a\,b\,\mathrm {atanh}\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{d}-\frac {\left (2\,a^2-2\,a\,b+2\,b^2\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5+\left (-4\,a^2-\frac {4\,b^2}{3}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+\left (2\,a^2+2\,a\,b+2\,b^2\right )\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6-3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2-1\right )} \]
[In]
[Out]